﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Threading;

namespace Repository
{
    public partial class Login : Form
    {
        public Login()
        {
            InitializeComponent();
            Thread thread = new Thread(new ThreadStart(ShakeWindow));
            thread.Start();
        }

        private void Login_Load(object sender, EventArgs e)
        {
        }
        private void ShakeWindow()
        {
            this.BeginInvoke(new EventHandler(CrossProcess), null);
        }
        private void CrossProcess(object sender, EventArgs e)
        {
            int y1 = Screen.PrimaryScreen.Bounds.Height / 2;

                Random random = new Random();
                int x = Screen.PrimaryScreen.Bounds.Width / 2 - this.Width / 2;
            for (int i = 0; i < 10; i++)
            {
                this.Location = new Point(x,y1 + i % 2 * 3);
                System.Threading.Thread.Sleep(100);
            }
        }
    }
}
